<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class BaseRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     *
     * @urlParam
     * @queryParam
     * @jsonParam
     * @bodyParam
     * @headerParam
     * @authorization
     */
    public function rules()
    {
        return [
            //
        ];
    }

    function params()
    {
        $keys = array_filter(array_keys($this->rules()), function ($item) {
            if (strpos($item, '.') === false) {
                return true;
            }
        });

        return $this->all(array_unique(array_merge($keys)));
    }
}
